import os
from typing import Dict

from utils import model, utils

__dir__ = os.path.dirname(__file__)
support_md = os.path.join(__dir__, '../setting/support.md')
default_voice_name = 'zh-CN-XiaoxiaoNeural'


# c =
def read_support_md() -> Dict[str, model.SupportTable]:
    table_list = utils.read_md_table(support_md)
    for table in table_list:
        style_list = [i.strip() for i in table['style'].split(',') if i.strip()]
        table['style'] = style_list
    table_list = [model.SupportTable(**table) for table in table_list]
    support = {
        table.voice: table
        for table in table_list
    }
    return support


if __name__ == '__main__':
    aa = read_support_md()
    print(aa)
